
open(INFILE, "<sn.txt") or die "Couldn't read from sn.txt!";
$sn = <INFILE>;
chomp($sn);
close(INFILE) or die "Couldn't close sn.txt!";
print "Today's build number is ", $sn, ".\n";

$basedir = "D:\\DailyBuild\\";
$to = $basedir . $sn. "\\";
mkdir($to, 0777) or die "Couldn't make dir <", $to, ">!";
print "Daily build path: ", $to, "\n";

$sn += 1;
open(OUTFILE,">sn.txt") or die "Couldn't write into sn.txt";
print OUTFILE $sn;
close(OUTFILE) or die "Couldn't close sn.txt!";

# "BackOfficeCIB", "TerminalCIB", "BackOfficeCIB_Java", "TerminalCIB_Java", "BackOfficeShanghai", "TerminalShanghai",  "HengtianDataServiceSystem", "FXKS", 
foreach("FXLPSystem", "FICPIServer", "FrontProcessor", "UDISS-Server", "UDISS-Client", "FICPIServerDataExport", "BeeBank", "FXfund_yantai", "CMDS_FX", "BondTradeSys", "WASS", "FXKS", "CreditSys","CreditSys_hanting", "MarketAnalysisSystem", "dhbond", "HengtianDataServiceSystem"){
$from = $basedir . $_;
$todir = $to . $_;
print $from, "==>", $todir, "\n";
`xcopy /E /I /Y $from $todir`;
}

$time = localtime;
print "Complete time: ", $time, "\n";

